  <div class="row">
      <div class="col-lg-12">
          <section class="panel">
              <header class="panel-heading">
                  终端列表
              </header>
              <div class="panel-body">
                <div class="clearfix">
                    <div class="btn-group">
                      <span class="btn btn-primary" >
                        <%= link_to fa_icon("plus"), new_admin_terminal_path %>
                      </span>


                    </div>
                </div>

                <br />
                <%= form_tag import_admin_terminals_path, :multipart => true , class: "form-inline" do %>
                  <div class="form-group">
                    <div>
                      <%= file_field_tag "file", class: "btn btn-default btn-sm form-control" %>
                    </div>
                  </div>
                  <%= submit_tag "导入", class: "btn btn-success" %>

                  <span class="btn btn-primary" >
                    <%= link_to "导出模板",export_admin_terminals_path({format: :csv}.merge!(params)) %>
                  </span>
                <% end %>

                <div class="space15"></div>

                <% if flash[:success].present? %>
                  <div class="alert alert-success fade in">
                    <button class="close" data-dismiss="alert">
                      ×
                    </button>
                    <i class="fa-fw fa fa-check"></i>
                    <strong>成功</strong> <%= flash[:success] %>
                  </div>
                <% elsif flash[:error].present? %>
                  <div class="alert alert-danger fade in">
                    <button class="close" data-dismiss="alert">
                      ×
                    </button>
                    <i class="fa-fw fa fa-times"></i>
                    <strong>错误!</strong> <%= flash[:error] %>
                  </div>
                <% end %>

                <table class="table table-striped table-advance table-hover">
                  <thead>
                    <tr>
                      <th>Mac</th>
                      <th>Mid</th>
                      <th>Imei</th>
                      <th>Sim iccid</th>
                      <th>Status</th>
                      <th colspan="3"></th>
                    </tr>
                  </thead>

                  <tbody>
                    <% @terminals.each do |terminal| %>
                      <tr>
                        <td><%= terminal.mac %></td>
                        <td><%= terminal.mid %></td>
                        <td><%= terminal.imei %></td>
                        <td><%= terminal.sim_iccid %></td>
                        <td><%= terminal.status %></td>
                        <td>
                          <span class="btn btn-success btn-xs"><%= link_to fa_icon("check"), [:admin, terminal] %></span>
                          <span class="btn btn-primary btn-xs"><%= link_to fa_icon("pencil"), edit_admin_terminal_path(terminal) %><i class="icon-pencil"></i></span>
                          <span class="btn btn-danger btn-xs"><%= link_to fa_icon("trash-o"), [:admin, terminal], method: :delete, data: { confirm: 'Are you sure?' } %></span>
                        </td>
                      </tr>
                    <% end %>
                  </tbody>
              </table>
              </div>
          </section>
      </div>
  </div>
  <!-- page end-->

